alert("hello");
var xmlHttp;
function  createXMLHttp(){
	if(window.XMLHttpRequest){
		xmlHttp = new XMLHttpRequest();
	}else{
		xmlHttp= new ActiveXobject("Microsoft.XMLHTTP");
	}
}

function showMsg(){
	createXMLHttp();
	xmlHttp.open("post","page.do");
	xmlHttp.onreadystatechange=showMsgCallback;
	xmlHttp.send(null);
}

function showMsgCallback(){

	if(xmlHttp.readyState == 4){
		if(xmlHttp.status ==200){
			var text = xmlHttp.responseText;
			var obj = JSON.parse(text);
			var count=obj["count"];
			var pre =obj["pre"];
			var html=document.getElementById("box").innerHTML;
			if(parseInt(pre) > 1)
			     html=html+"<a href='#?pre="+(parseInt(pre)-1)+"'>上一页</a>&nbsp;&nbsp;";
			else html=html+"<a href='#'>上一页</a>&nbsp;&nbsp;";
			for(var i=1;i<=count;i++){
				html=html+"<a href='#?pre="+i+"'>"+i+"</a>&nbsp;&nbsp;";
			}
			if(parseInt(pre) < count)
			     html=html+"<a href='#?pre="+(parseInt(pre)+1)+"'>下一页</a>&nbsp;&nbsp;";
			else html=html+"<a href='#'>下一页</a>&nbsp;&nbsp;";
			document.getElementById("box").innerHTML=html;
//			for(var i in obj){
//				msg=msg+obj[i];
//			}
//			document.getElementById("box").innerHTML=msg;
		}
	}	
}
showMsg();